home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update20.zoo / gdb / diffs
Encoding:
Text File  |  1992-04-19  |  15.7 KB  |  590 lines

  1. *** 1.15    1992/03/09 18:12:41
  2. --- Changelo    1992/04/19 16:36:09
  3. ***************
  4. *** 179,181 ****
  5. --- 179,215 ----
  6.       open the log file when buffer fills up, dump buffer, close file
  7.       and so on.
  8.   ------------------------------- Patchlevel  17 -----------------------------
  9. + many places:: ++jrb
  10. +     undo all changes since PL 17, because nothing was working. Sigh!
  11. + atarist.c:: andreas
  12. +        (st_execle_kludge): convert PATH as in spawn..;
  13. +     don't do anything but longjmp after Pexec because the stack is
  14. +     *very* small!
  15. +     (re_comp): free compiled regex
  16. +     (st_child_read_word, st_child_write_word): handle bus errors
  17. +     (kill): allow GDB output to be interrupted
  18. + utils.c:: andreas
  19. +         (quit): handle interrupts
  20. + dbxread.c:: andreas
  21. +         handle gcc-2 symbol table extensions
  22. + findvar.c:: andreas
  23. +         correctly handle function types
  24. + infcmd.c:: andreas
  25. +         (run_command): avoid confusion after user tried to
  26. +     start program again
  27. +     (finish_command): correctly handle function return type
  28. + main.c:: andreas
  29. +         (Save_all_vectors): Setexc(N,-1) does work
  30. + source.c:: andreas
  31. +         (directory_command): correctly handle atari-like
  32. +     absolute file names
  33. + ------------------------------- Patchlevel  18 -----------------------------
  34. *** 1.10    1992/03/09 18:12:41
  35. --- PatchLev.h    1992/04/19 16:36:09
  36. ***************
  37. *** 1,4 ****
  38. ! #define PatchLevel "17"
  39.   
  40.   /*
  41.    *    the Patch Level above is to identify the version
  42. --- 1,4 ----
  43. ! #define PatchLevel "18"
  44.   
  45.   /*
  46.    *    the Patch Level above is to identify the version
  47. *** 1.11    1992/03/09 18:12:41
  48. --- README    1992/04/19 16:36:10
  49. ***************
  50. *** 1,3 ****
  51. --- 1,15 ----
  52. + GDB @ Patchlevel 18
  53. +     - many of you had difficulty with finding gdb @Patchlevel 16
  54. +     to patch to PL 17 with the last set of diffs. I apologize for
  55. +     this. gdb@pl 17 is now available on atari.archive.umich.edu
  56. +     for you to apply the 17->18 diffs.
  57. +     - many small bug fixes.
  58. +     - gdb -L is not working reliably. i still have'nt tracked this down.
  59. +     But other than that gdb is doing quite well.
  60.   GDB @ Patchlevel 17
  61.       - gdb -L (logging) now always works independent of TOS etc.
  62.   
  63. *** 1.19    1992/01/29 16:45:54
  64. --- atarist.c    1992/04/19 16:36:10
  65. ***************
  66. *** 111,121 ****
  67.       p = kludge_env = xmalloc(envlen);
  68.       
  69.       for (i = 0; env[i]; i++)
  70. !     {
  71. !     for (q = env[i]; *q; q++)
  72.           *p++ = *q;
  73.       *p++ = '\0';
  74. !     }
  75.       *p = '\0';
  76.       
  77.       /* the obligatory cmd line parsing */
  78. --- 111,148 ----
  79.       p = kludge_env = xmalloc(envlen);
  80.       
  81.       for (i = 0; env[i]; i++)
  82. !       {
  83. !     /*
  84. !      * NOTE: in main.c, we converted the PATH environment variable into
  85. !      * POSIX form. Here, we convert back into gulam form. Note that the
  86. !      * new variable will be shorter than the old, so space is not a
  87. !      * problem.
  88. !      */
  89. !     if (!strncmp (env[i], "PATH=", 5))
  90. !       {
  91. !         strncpy (p, env[i], 5);
  92. !         p += 5;
  93. !         for (q = env[i] + 5; *q; q++)
  94. !           {
  95. !         if (!strncmp (q, "/dev/", 5) && q[5])
  96. !           {
  97. !             *p++ = q[5];
  98. !             *p++ = ':';
  99. !             q += 5;
  100. !           }
  101. !         else if (*q == ':')
  102. !           *p++ = ',';
  103. !         else if (*q == '/')
  104. !           *p++ = '\\';
  105. !         else
  106. !           *p++ = *q;
  107. !           }
  108. !       }
  109. !     else
  110. !       for (q = env[i]; *q; q++)
  111.           *p++ = *q;
  112.       *p++ = '\0';
  113. !       }
  114.       *p = '\0';
  115.       
  116.       /* the obligatory cmd line parsing */
  117. ***************
  118. *** 174,179 ****
  119. --- 201,208 ----
  120.           /* we're returning after the child exits.  the stack
  121.              is all fucked here, so reset to top level */
  122.           child_is_running = 0;
  123. +         fprintf(stderr, "Program exitted with status %ld\n", 
  124. +             kludge_pexec_result);
  125.           exception_number = SIGTRACE;    /* not really... */
  126.           inferior_died();        /* I think this is safe here */
  127.           return_to_top_level();    /* clean up stack and restart */
  128. ***************
  129. *** 216,229 ****
  130.           trap #1
  131.           movel d0,_kludge_pexec_result");
  132.   #endif
  133. -         /* DO NOT REMOVE THIS PRINTF!!!
  134. -            For reasons I can't divine, it causes GDB to wedge totally
  135. -            when the child program exits.  If anybody ever figures this out,
  136. -            please let me know!
  137. -            */
  138. -         fprintf_filtered(stderr, "Program exitted with status 0x%lx\n", 
  139. -             kludge_pexec_result);
  140. -         
  141.           
  142.   #if 0
  143.           free(kludge_env);
  144. --- 245,250 ----
  145. ***************
  146. *** 257,265 ****
  147.   
  148.   #if 1 /* def JRDLIB */
  149.   /* called various places */
  150. ! int kill(fake_pid)
  151.   int fake_pid;
  152.   {
  153.       if (fake_pid == CHILD_PID_KLUDGE)
  154.       {
  155.       /* if the child is running, then TOS thinks we're it, so just exit */
  156. --- 278,289 ----
  157.   
  158.   #if 1 /* def JRDLIB */
  159.   /* called various places */
  160. ! int kill(fake_pid, signal)
  161.   int fake_pid;
  162. + int signal;
  163.   {
  164. +   extern void request_quit();
  165.       if (fake_pid == CHILD_PID_KLUDGE)
  166.       {
  167.       /* if the child is running, then TOS thinks we're it, so just exit */
  168. ***************
  169. *** 269,274 ****
  170. --- 293,303 ----
  171.       else
  172.           fprintf_filtered(stderr, "Internal error: attempt to kill when child not running\n");
  173.       }
  174. +     else if (fake_pid == getpid ())
  175. +       {
  176. +     if (signal == SIGINT)
  177. +       request_quit();
  178. +       }
  179.       else
  180.       fprintf_filtered(stderr, "You can't kill pid %d, bozo!\n", fake_pid);
  181.       
  182. ***************
  183. *** 309,314 ****
  184. --- 338,344 ----
  185.   char *regex;
  186.   {
  187.       regcomp_error = NULL;
  188. +     if (compiled_regex) free(compiled_regex);
  189.       if (compiled_regex = regcomp(regex))
  190.       return NULL;
  191.       else
  192. ***************
  193. *** 459,477 ****
  194.       fprintf_filtered(stderr, "Child is not running\n");
  195.   }
  196.   
  197.   /* read a 32-bit word from child memory */
  198.   st_child_read_word(addr)
  199. ! long * addr;
  200.   {
  201.       long result;
  202.       
  203. !     /*  fprintf_filtered(stderr, "st_child_read_word %X", addr); */
  204. !     /* be sure addr is within child memory to prevent bus errors */
  205. !     if (addr >= child_tpa->text_base - 1 && addr < child_tpa->memtop + 1)
  206. !       result = *addr;
  207. !     else
  208. !       result = 0;
  209. !     /*  fprintf_filtered(stderr, "->%X\n", result);    */
  210.       return(result);
  211.   }
  212.   
  213. --- 489,513 ----
  214.       fprintf_filtered(stderr, "Child is not running\n");
  215.   }
  216.   
  217. + void st_bus_error_handler ()
  218. + {
  219. +   asm volatile ("andw #~0x2000,sr");
  220. +   error ("Bus error while reading from or writing to child memory.");
  221. + }
  222.   /* read a 32-bit word from child memory */
  223.   st_child_read_word(addr)
  224. ! volatile long * addr;
  225.   {
  226.       long result;
  227. +     long old_buserror;
  228.       
  229. !     /*  fprintf(stderr, "st_child_read_word %X", addr); */
  230. !     /* report bus errors */
  231. !     old_buserror = (long) Setexc (2, st_bus_error_handler);
  232. !     result = *addr;
  233. !     (void) Setexc (2, old_buserror);
  234. !     /*  fprintf(stderr, "->%X\n", result);    */
  235.       return(result);
  236.   }
  237.   
  238. ***************
  239. *** 478,489 ****
  240.   /* write a 32-bit word to child mem */
  241.   st_child_write_word(addr, value)
  242.   long * addr;
  243. ! long value;
  244.   {
  245. !     /*  fprintf_filtered(stderr, "st_child_write_word %X <- %X\n", addr, value); */
  246. !     /* be sure addr is within child memory to prevent bus errors */
  247. !     if (addr >= child_tpa->text_base - 1 && addr < child_tpa->memtop + 1)
  248. !       *addr = value;
  249.   }
  250.   
  251.   #define DEBUG 1
  252. --- 514,527 ----
  253.   /* write a 32-bit word to child mem */
  254.   st_child_write_word(addr, value)
  255.   long * addr;
  256. ! volatile long value;
  257.   {
  258. !     long old_buserror;
  259. !     /*  fprintf(stderr, "st_child_write_word %X <- %X\n", addr, value); */
  260. !     /* report bus errors */
  261. !     old_buserror = (long) Setexc (2, st_bus_error_handler);
  262. !     *addr = value;
  263. !     (void) Setexc (2, old_buserror);
  264.   }
  265.   
  266.   #define DEBUG 1
  267. *** 1.15    1992/01/29 16:45:54
  268. --- dbxread.c    1992/04/19 16:36:13
  269. ***************
  270. *** 1110,1116 ****
  271.     register struct misc_bunch *new;
  272.   
  273.   #ifdef atarist
  274. !   if(strcmp(name, "gcc_compiled.") == 0)
  275.         return;
  276.   #endif
  277.     
  278. --- 1110,1117 ----
  279.     register struct misc_bunch *new;
  280.   
  281.   #ifdef atarist
  282. !   if (strcmp (name, "gcc_compiled.") == 0 ||
  283. !       strcmp (name, "gcc2_compiled.") == 0)
  284.         return;
  285.   #endif
  286.     
  287. ***************
  288. *** 1897,1902 ****
  289. --- 1898,1909 ----
  290.        and possibly more stuff to define the type
  291.        (all of which is handled by read_type)  */
  292.   
  293. +   if (deftype == 'T' && *p == 't')
  294. +     {
  295. +       deftype = 't';
  296. +       p++;
  297. +     }
  298.     if (deftype == 'p' && *p == 'F')
  299.       /* pF is a two-letter code that means a function parameter in Fortran.
  300.          The type-number specifies the type of the return value.
  301. ***************
  302. *** 2335,2340 ****
  303. --- 2342,2348 ----
  304.         break;
  305.         
  306.       case '*':
  307. +     case '&':
  308.   #if 0
  309.         type1 = read_type (pp);
  310.         if (TYPE_POINTER_TYPE (type1))
  311. ***************
  312. *** 2655,2661 ****
  313. --- 2663,2673 ----
  314.   
  315.     /* Now fill in the fields of the type-structure.  */
  316.   
  317. + #ifdef atarist
  318. +   TYPE_LENGTH (type) = gcc_mshort ? sizeof (short) : sizeof (int);
  319. + #else
  320.     TYPE_LENGTH (type) = sizeof (int);
  321. + #endif
  322.     TYPE_CODE (type) = TYPE_CODE_ENUM;
  323.     TYPE_NFIELDS (type) = nsyms;
  324.     TYPE_FIELDS (type) = (struct field *) obstack_alloc (symbol_obstack, sizeof (struct field) * nsyms);
  325. ***************
  326. *** 2678,2685 ****
  327.         struct symbol *sym = syms->symbol[j];
  328.         SYMBOL_TYPE (sym) = type;
  329.         TYPE_FIELD_NAME (type, n) = SYMBOL_NAME (sym);
  330. !       TYPE_FIELD_VALUE (type, n) = 0;
  331. !       TYPE_FIELD_BITPOS (type, n) = SYMBOL_VALUE (sym);
  332.         TYPE_FIELD_BITSIZE (type, n++) = 0;
  333.       }
  334.         if (syms == osyms)
  335. --- 2690,2697 ----
  336.         struct symbol *sym = syms->symbol[j];
  337.         SYMBOL_TYPE (sym) = type;
  338.         TYPE_FIELD_NAME (type, n) = SYMBOL_NAME (sym);
  339. !       TYPE_FIELD_BITPOS (type, n) = 0;
  340. !       TYPE_FIELD_VALUE (type, n) = SYMBOL_VALUE (sym);
  341.         TYPE_FIELD_BITSIZE (type, n++) = 0;
  342.       }
  343.         if (syms == osyms)
  344. ***************
  345. *** 2745,2751 ****
  346.       return builtin_type_unsigned_int;
  347.       }
  348.   #ifdef atarist
  349. -    /* special case for -mshort */
  350.     else if (n2 == -32768 && n3 == 32767 && typenums[1] == 1)
  351.       {
  352.         gcc_mshort = 1;
  353. --- 2757,2762 ----
  354. *** 1.5    1992/01/14 20:05:42
  355. --- findvar.c    1992/04/19 16:36:16
  356. ***************
  357. *** 213,220 ****
  358. --- 213,222 ----
  359.     int val = SYMBOL_VALUE (var);
  360.     register int len;
  361.   
  362. + #if 0
  363.     if (SYMBOL_CLASS (var) == LOC_BLOCK)
  364.       type = lookup_function_type (type);
  365. + #endif
  366.   
  367.     v = allocate_value (type);
  368.     VALUE_LVAL (v) = lval_memory;    /* The most likely possibility.  */
  369. ***************
  370. *** 361,368 ****
  371. --- 363,372 ----
  372.   
  373.     if (frame == 0) frame = selected_frame;
  374.   
  375. + #if 0
  376.     if (SYMBOL_CLASS (var) == LOC_BLOCK)
  377.       type = lookup_function_type (type);
  378. + #endif
  379.   
  380.     switch (SYMBOL_CLASS (var))
  381.       {
  382. *** 1.10    1991/11/30 17:37:25
  383. --- infcmd.c    1992/04/19 16:36:19
  384. ***************
  385. *** 197,208 ****
  386.       }
  387.   
  388.         allargs = concat ("exec ", exec_file, inferior_args);
  389.         inferior_pid = create_inferior (allargs, environ_vector (inferior_environ));
  390.   
  391. ! #ifdef atarist
  392. !       if(inferior_pid == -9999)
  393. !         error("Program already started or run once. Cannot restart program on\
  394. !  the atariST.\nExit GDB and start again if you want to do this.");
  395.   #endif
  396.       }
  397.   
  398. --- 197,212 ----
  399.       }
  400.   
  401.         allargs = concat ("exec ", exec_file, inferior_args);
  402. + #ifndef atarist
  403.         inferior_pid = create_inferior (allargs, environ_vector (inferior_environ));
  404. + #else
  405. +       i = create_inferior (allargs, environ_vector (inferior_environ));
  406. +       if (i == -9999)
  407. +         error ("\
  408. + Program already started or run once. Cannot restart program on the atariST.\n\
  409. + Exit GDB and start again if you want to do this.");
  410.   
  411. !       inferior_pid = i;
  412.   #endif
  413.       }
  414.   
  415. ***************
  416. *** 561,570 ****
  417. --- 565,579 ----
  418.         if (!value_type)
  419.       fatal ("internal: finish_command: function has no target type");
  420.   
  421. + #if 0
  422.         if (TYPE_CODE (SYMBOL_TYPE (function)) != TYPE_CODE_VOID)
  423.       value_type = SYMBOL_TYPE (function);
  424.         else
  425.       return;
  426. + #else
  427. +       if (TYPE_CODE (value_type) == TYPE_CODE_VOID)
  428. +     return;
  429. + #endif
  430.   
  431.         funcaddr = BLOCK_START (SYMBOL_BLOCK_VALUE (function));
  432.   
  433. *** 1.7    1992/03/09 18:12:41
  434. --- main.c    1992/04/19 16:36:21
  435. ***************
  436. *** 531,536 ****
  437. --- 531,537 ----
  438.         if(atari_logfile)
  439.         {
  440.         append_atari_logfile(line);
  441. +       append_atari_logfile(" (previous command repeated)\n");
  442.         }
  443.         return line;
  444.     }
  445. ***************
  446. *** 1312,1339 ****
  447.   
  448.   static void Save_all_vectors()
  449.   {
  450. !     s_vectors[2] = set_exception_vector(2, do_nothing);
  451. !     /* akp: why does Setexc(-N,..) not work?? */
  452. !     set_exception_vector(2, s_vectors[2]);
  453. !     s_vectors[3] = set_exception_vector(3, do_nothing);
  454. !     set_exception_vector(3, s_vectors[3]);
  455. !     s_vectors[4] = set_exception_vector(4, do_nothing);
  456. !     set_exception_vector(4, s_vectors[4]);
  457. !     s_vectors[5] = set_exception_vector(5, do_nothing);
  458. !     set_exception_vector(5, s_vectors[5]);
  459. !     s_vectors[6] = set_exception_vector(6, do_nothing);
  460. !     set_exception_vector(6, s_vectors[6]);
  461. !     s_vectors[7] = set_exception_vector(7, do_nothing);
  462. !     set_exception_vector(7, s_vectors[7]);
  463. !     s_vectors[8] = set_exception_vector(8, do_nothing);
  464. !     set_exception_vector(8, s_vectors[8]);
  465. !     s_vectors[9] = set_exception_vector(9, do_nothing);
  466. !     set_exception_vector(9, s_vectors[9]);
  467.       
  468. !     s_trap_0_vector = set_exception_vector(32, do_nothing);
  469. !     set_exception_vector(32, s_trap_0_vector);
  470. !     s_trap_f_vector = set_exception_vector(47, do_nothing);
  471. !     set_exception_vector(47, s_trap_f_vector);
  472.   }
  473.   
  474.   static void Restore_all_vectors()
  475. --- 1313,1329 ----
  476.   
  477.   static void Save_all_vectors()
  478.   {
  479. !     s_vectors[2] = set_exception_vector(2, -1L);
  480. !     s_vectors[3] = set_exception_vector(3, -1L);
  481. !     s_vectors[4] = set_exception_vector(4, -1L);
  482. !     s_vectors[5] = set_exception_vector(5, -1L);
  483. !     s_vectors[6] = set_exception_vector(6, -1L);
  484. !     s_vectors[7] = set_exception_vector(7, -1L);
  485. !     s_vectors[8] = set_exception_vector(8, -1L);
  486. !     s_vectors[9] = set_exception_vector(9, -1L);
  487.       
  488. !     s_trap_0_vector = set_exception_vector(32, -1L);
  489. !     s_trap_f_vector = set_exception_vector(47, -1L);
  490.   }
  491.   
  492.   static void Restore_all_vectors()
  493. *** 1.7    1991/11/30 17:37:25
  494. --- source.c    1992/04/19 16:36:24
  495. ***************
  496. *** 190,196 ****
  497.       }
  498.   
  499.   #ifdef atarist
  500. !       if (((dirname[0] != '\\') || (dirname[0] != '/')) && (dirname[1] != ':'))
  501.       dirname = concat (current_directory, "\\", dirname);
  502.   #else
  503.         if (dirname[0] != '/')
  504. --- 190,196 ----
  505.       }
  506.   
  507.   #ifdef atarist
  508. !       if ((dirname[0] != '\\') && (dirname[0] != '/') && (dirname[1] != ':'))
  509.       dirname = concat (current_directory, "\\", dirname);
  510.   #else
  511.         if (dirname[0] != '/')
  512. *** 1.10    1991/11/30 17:37:25
  513. --- symtab.c    1992/04/19 16:36:27
  514. ***************
  515. *** 49,54 ****
  516. --- 49,58 ----
  517.   struct type *builtin_type_float;
  518.   struct type *builtin_type_double;
  519.   
  520. + #ifdef atarist
  521. + extern int gcc_mshort;
  522. + #endif
  523.   /* Lookup the symbol table of a source file named NAME.  Try a couple
  524.      of variations if the first lookup doesn't work.  */
  525.   
  526. ***************
  527. *** 121,126 ****
  528. --- 125,135 ----
  529.     if (sym == 0 || SYMBOL_CLASS (sym) != LOC_TYPEDEF)
  530.       {
  531.         if (!strcmp (name, "int"))
  532. + #ifdef atarist
  533. +     if (gcc_mshort)
  534. +       return builtin_type_short;
  535. +     else
  536. + #endif
  537.       return builtin_type_int;
  538.         if (!strcmp (name, "long"))
  539.       return builtin_type_long;
  540. ***************
  541. *** 147,152 ****
  542. --- 156,166 ----
  543.        char *name;
  544.   {
  545.     if (!strcmp (name, "int"))
  546. + #ifdef atarist
  547. +     if (gcc_mshort)
  548. +       return builtin_type_unsigned_short;
  549. +     else
  550. + #endif
  551.       return builtin_type_unsigned_int;
  552.     if (!strcmp (name, "long"))
  553.       return builtin_type_unsigned_long;
  554. *** 1.6    1991/11/30 17:37:25
  555. --- utils.c    1992/04/19 16:36:27
  556. ***************
  557. *** 222,228 ****
  558.     ioctl (fileno (stdout), TIOCFLUSH, 0);
  559.   #endif
  560.   #endif /* not HAVE_TERMIO */
  561. ! #ifdef TIOCGPGRP
  562.     error ("Quit");
  563.   #else
  564.     error ("Quit (expect signal %d when inferior is resumed)", SIGINT);
  565. --- 222,228 ----
  566.     ioctl (fileno (stdout), TIOCFLUSH, 0);
  567.   #endif
  568.   #endif /* not HAVE_TERMIO */
  569. ! #if defined (TIOCGPGRP) || defined (atarist)
  570.     error ("Quit");
  571.   #else
  572.     error ("Quit (expect signal %d when inferior is resumed)", SIGINT);
  573.